home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Screenblankers
/
RXBlank
/
RXBlank
next >
Wrap
Text File
|
1996-09-26
|
4KB
|
120 lines
/*
** RXBlank v1.0
** By Brian C. Berg
** 19-Jan-92
**
** This little AREXX program will install a random screen blanker in your
** WBStartup drawer.
**
** USAGE: RX RXBlank <pathname>
**
*/
OPTIONS RESULTS
/**************************************************************************/
/**** IS REXXSUPPORT.LIBRARY OPEN? ****/
/**************************************************************************/
if ~show('L', "rexxsupport.library") then do
if addlib('rexxsupport.library', 0, -30,0) then do
say ""
end
else do
say "RexxSupport.library not available, exiting..."
exit 10
end
end
/**************************************************************************/
/**************************************************************************/
/**** PARSE ARGUMENTS ****/
/**************************************************************************/
parse arg path
IF (path = '') | (path = '?') then do /* No path given */
say "RXBlank v1.0 By Brian C. Berg" /* so display usage */
say "USAGE: RXBlank <pathname>"
exit
END
IF (~exists(path)) then do /* Can't find path */
say "Can't find path "path
exit
END
trim(path) /* Check for / at end of path and add one*/
IF right(path, 1) ~= "/" then do /* if not already there. */
path = path"/"
END
/**************************************************************************/
/**************************************************************************/
/*********** MAIN PROGRAM ***************/
/**************************************************************************/
say "RXBlank v1.0 By Brian C. Berg"
files = showdir(path, "f") /* Get list of */
IF ~open('list', 'ram:RXBlank.temp', "W") then do /* files in the */
say "Can't open temporary file in RAM:, exiting..." /* directory. */
END
numwords = words(files) /* Initialize some variable */
x = 1
num = 0
do while (x <= numwords) /* Loop to sort through all files in the dir */
call STRIPNAMES
x = x + 1
end
close('list') /* Close and reopen temp file */
open('list', 'ram:RXBlank.temp', "R") /* to reset pointer. */
call CHOOSEBLANKER /* Pick the random number */
close('list') /* Close the temp file */
ADDRESS COMMAND 'delete >nil: ram:RXBlank.temp' /* and delete it */
EXIT
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/******** SUB ROUTINES ********/
/**************************************************************************/
STRIPNAMES: /* This routine will find all files */
name = word(files, x) /* in the directory and pick out */
if right(name, 5) ~= '.info' then do /* the blankers from the .info files*/
writeln('list', name)
num = num + 1
end
RETURN
/*------------------------------------------------------------------------*/
CHOOSEBLANKER: /* This routine picks a random number*/
/* based on how many blankers it found */
/* and then copies it to the WBstartup*/
/* drawer along with it's icon.*/
Bnum = random(1,num,random(1,100,(TIME(SECONDS))))
y = 1
do while (y <= Bnum)
name = readln('list')
y = y + 1
end
ADDRESS COMMAND 'copy >nil: 'path''name' SYS:WBStartup/Blanker'
ADDRESS COMMAND 'copy >nil: 'path''name'.info SYS:WBStartup/Blanker.info'
say 'Blanker Installed: 'name
RETURN
/**************************************************************************/